Integrand size = 15, antiderivative size = 64 \[ \int x^2 \cot ^2(a+i \log (x)) \, dx=-6 e^{2 i a} x-\frac {x^3}{3}-\frac {2 e^{2 i a} x^3}{e^{2 i a}-x^2}+6 e^{3 i a} \text {arctanh}\left (e^{-i a} x\right ) \]
Time = 0.13 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.56 \[ \int x^2 \cot ^2(a+i \log (x)) \, dx=-\frac {x^3}{3}-4 x \cos (2 a)+6 \text {arctanh}(x (\cos (a)-i \sin (a))) \cos (3 a)-4 i x \sin (2 a)+\frac {2 x (\cos (3 a)+i \sin (3 a))}{\left (-1+x^2\right ) \cos (a)-i \left (1+x^2\right ) \sin (a)}+6 i \text {arctanh}(x (\cos (a)-i \sin (a))) \sin (3 a) \]
-1/3*x^3 - 4*x*Cos[2*a] + 6*ArcTanh[x*(Cos[a] - I*Sin[a])]*Cos[3*a] - (4*I )*x*Sin[2*a] + (2*x*(Cos[3*a] + I*Sin[3*a]))/((-1 + x^2)*Cos[a] - I*(1 + x ^2)*Sin[a]) + (6*I)*ArcTanh[x*(Cos[a] - I*Sin[a])]*Sin[3*a]
Time = 0.26 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.28, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.467, Rules used = {5007, 947, 366, 27, 363, 262, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int x^2 \cot ^2(a+i \log (x)) \, dx\) |
\(\Big \downarrow \) 5007 |
\(\displaystyle \int \frac {x^2 \left (-\frac {i e^{2 i a}}{x^2}-i\right )^2}{\left (1-\frac {e^{2 i a}}{x^2}\right )^2}dx\) |
\(\Big \downarrow \) 947 |
\(\displaystyle \int \frac {x^2 \left (-i e^{2 i a}-i x^2\right )^2}{\left (x^2-e^{2 i a}\right )^2}dx\) |
\(\Big \downarrow \) 366 |
\(\displaystyle \frac {1}{2} e^{-2 i a} \int \frac {2 x^2 \left (e^{2 i a} x^2+5 e^{4 i a}\right )}{e^{2 i a}-x^2}dx-\frac {2 e^{2 i a} x^3}{-x^2+e^{2 i a}}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle e^{-2 i a} \int \frac {x^2 \left (e^{2 i a} x^2+5 e^{4 i a}\right )}{e^{2 i a}-x^2}dx-\frac {2 e^{2 i a} x^3}{-x^2+e^{2 i a}}\) |
\(\Big \downarrow \) 363 |
\(\displaystyle e^{-2 i a} \left (6 e^{4 i a} \int \frac {x^2}{e^{2 i a}-x^2}dx-\frac {1}{3} e^{2 i a} x^3\right )-\frac {2 e^{2 i a} x^3}{-x^2+e^{2 i a}}\) |
\(\Big \downarrow \) 262 |
\(\displaystyle e^{-2 i a} \left (6 e^{4 i a} \left (-x+e^{2 i a} \int \frac {1}{e^{2 i a}-x^2}dx\right )-\frac {1}{3} e^{2 i a} x^3\right )-\frac {2 e^{2 i a} x^3}{-x^2+e^{2 i a}}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle e^{-2 i a} \left (6 e^{4 i a} \left (-x+e^{i a} \text {arctanh}\left (e^{-i a} x\right )\right )-\frac {1}{3} e^{2 i a} x^3\right )-\frac {2 e^{2 i a} x^3}{-x^2+e^{2 i a}}\) |
(-2*E^((2*I)*a)*x^3)/(E^((2*I)*a) - x^2) + (-1/3*(E^((2*I)*a)*x^3) + 6*E^( (4*I)*a)*(-x + E^(I*a)*ArcTanh[x/E^(I*a)]))/E^((2*I)*a)
3.2.95.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) ^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ (b*(m + 2*p + 1))) Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b , c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c , 2, m, p, x]
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2), x _Symbol] :> Simp[d*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(b*e*(m + 2*p + 3))), x] - Simp[(a*d*(m + 1) - b*c*(m + 2*p + 3))/(b*(m + 2*p + 3)) Int[(e*x)^ m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && NeQ[b*c - a*d , 0] && NeQ[m + 2*p + 3, 0]
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^2, x_Symbol] :> Simp[(-(b*c - a*d)^2)*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(2*a* b^2*e*(p + 1))), x] + Simp[1/(2*a*b^2*(p + 1)) Int[(e*x)^m*(a + b*x^2)^(p + 1)*Simp[(b*c - a*d)^2*(m + 1) + 2*b^2*c^2*(p + 1) + 2*a*b*d^2*(p + 1)*x^ 2, x], x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && LtQ[p , -1]
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_. ), x_Symbol] :> Int[x^(m + n*(p + q))*(b + a/x^n)^p*(d + c/x^n)^q, x] /; Fr eeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[p, q] && NegQ[ n]
Int[Cot[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*((-I - I*E^(2*I*a*d)*x^(2*I*b*d))/(1 - E^(2*I*a*d)*x^(2*I*b* d)))^p, x] /; FreeQ[{a, b, d, e, m, p}, x]
Time = 1.07 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.75
method | result | size |
risch | \(-\frac {7 x^{3}}{3}-\frac {2 x^{3}}{\frac {{\mathrm e}^{2 i a}}{x^{2}}-1}-6 \,{\mathrm e}^{2 i a} x +6 \,\operatorname {arctanh}\left (x \,{\mathrm e}^{-i a}\right ) {\mathrm e}^{3 i a}\) | \(48\) |
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 102 vs. \(2 (47) = 94\).
Time = 0.24 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.59 \[ \int x^2 \cot ^2(a+i \log (x)) \, dx=-\frac {x^{5} + 11 \, x^{3} e^{\left (2 i \, a\right )} - 9 \, {\left (x^{2} - e^{\left (2 i \, a\right )}\right )} e^{\left (3 i \, a\right )} \log \left ({\left (x e^{\left (2 i \, a\right )} + e^{\left (3 i \, a\right )}\right )} e^{\left (-2 i \, a\right )}\right ) + 9 \, {\left (x^{2} - e^{\left (2 i \, a\right )}\right )} e^{\left (3 i \, a\right )} \log \left ({\left (x e^{\left (2 i \, a\right )} - e^{\left (3 i \, a\right )}\right )} e^{\left (-2 i \, a\right )}\right ) - 18 \, x e^{\left (4 i \, a\right )}}{3 \, {\left (x^{2} - e^{\left (2 i \, a\right )}\right )}} \]
-1/3*(x^5 + 11*x^3*e^(2*I*a) - 9*(x^2 - e^(2*I*a))*e^(3*I*a)*log((x*e^(2*I *a) + e^(3*I*a))*e^(-2*I*a)) + 9*(x^2 - e^(2*I*a))*e^(3*I*a)*log((x*e^(2*I *a) - e^(3*I*a))*e^(-2*I*a)) - 18*x*e^(4*I*a))/(x^2 - e^(2*I*a))
Time = 0.18 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.94 \[ \int x^2 \cot ^2(a+i \log (x)) \, dx=- \frac {x^{3}}{3} - 4 x e^{2 i a} + \frac {2 x e^{4 i a}}{x^{2} - e^{2 i a}} - 3 \left (\log {\left (x - e^{i a} \right )} - \log {\left (x + e^{i a} \right )}\right ) e^{3 i a} \]
-x**3/3 - 4*x*exp(2*I*a) + 2*x*exp(4*I*a)/(x**2 - exp(2*I*a)) - 3*(log(x - exp(I*a)) - log(x + exp(I*a)))*exp(3*I*a)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 335 vs. \(2 (47) = 94\).
Time = 0.22 (sec) , antiderivative size = 335, normalized size of antiderivative = 5.23 \[ \int x^2 \cot ^2(a+i \log (x)) \, dx=-\frac {2 \, x^{5} + 22 \, x^{3} {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} + 18 \, {\left ({\left (-i \, \cos \left (3 \, a\right ) + \sin \left (3 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) + {\left (-i \, \cos \left (3 \, a\right ) + \sin \left (3 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right )\right )} x^{2} - 36 \, x {\left (\cos \left (4 \, a\right ) + i \, \sin \left (4 \, a\right )\right )} + 18 \, {\left ({\left (i \, \cos \left (2 \, a\right ) - \sin \left (2 \, a\right )\right )} \cos \left (3 \, a\right ) - {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} \sin \left (3 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) + 18 \, {\left ({\left (i \, \cos \left (2 \, a\right ) - \sin \left (2 \, a\right )\right )} \cos \left (3 \, a\right ) - {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} \sin \left (3 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right ) - 9 \, {\left (x^{2} {\left (\cos \left (3 \, a\right ) + i \, \sin \left (3 \, a\right )\right )} - {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} \cos \left (3 \, a\right ) - {\left (i \, \cos \left (2 \, a\right ) - \sin \left (2 \, a\right )\right )} \sin \left (3 \, a\right )\right )} \log \left (x^{2} + 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) + 9 \, {\left (x^{2} {\left (\cos \left (3 \, a\right ) + i \, \sin \left (3 \, a\right )\right )} - {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} \cos \left (3 \, a\right ) + {\left (-i \, \cos \left (2 \, a\right ) + \sin \left (2 \, a\right )\right )} \sin \left (3 \, a\right )\right )} \log \left (x^{2} - 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right )}{6 \, {\left (x^{2} - \cos \left (2 \, a\right ) - i \, \sin \left (2 \, a\right )\right )}} \]
-1/6*(2*x^5 + 22*x^3*(cos(2*a) + I*sin(2*a)) + 18*((-I*cos(3*a) + sin(3*a) )*arctan2(sin(a), x + cos(a)) + (-I*cos(3*a) + sin(3*a))*arctan2(sin(a), x - cos(a)))*x^2 - 36*x*(cos(4*a) + I*sin(4*a)) + 18*((I*cos(2*a) - sin(2*a ))*cos(3*a) - (cos(2*a) + I*sin(2*a))*sin(3*a))*arctan2(sin(a), x + cos(a) ) + 18*((I*cos(2*a) - sin(2*a))*cos(3*a) - (cos(2*a) + I*sin(2*a))*sin(3*a ))*arctan2(sin(a), x - cos(a)) - 9*(x^2*(cos(3*a) + I*sin(3*a)) - (cos(2*a ) + I*sin(2*a))*cos(3*a) - (I*cos(2*a) - sin(2*a))*sin(3*a))*log(x^2 + 2*x *cos(a) + cos(a)^2 + sin(a)^2) + 9*(x^2*(cos(3*a) + I*sin(3*a)) - (cos(2*a ) + I*sin(2*a))*cos(3*a) + (-I*cos(2*a) + sin(2*a))*sin(3*a))*log(x^2 - 2* x*cos(a) + cos(a)^2 + sin(a)^2))/(x^2 - cos(2*a) - I*sin(2*a))
Time = 0.31 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.30 \[ \int x^2 \cot ^2(a+i \log (x)) \, dx=-\frac {x^{5}}{3 \, {\left (x^{2} - e^{\left (2 i \, a\right )}\right )}} - \frac {11 \, x^{3} e^{\left (2 i \, a\right )}}{3 \, {\left (x^{2} - e^{\left (2 i \, a\right )}\right )}} - \frac {6 \, \arctan \left (\frac {x}{\sqrt {-e^{\left (2 i \, a\right )}}}\right ) e^{\left (4 i \, a\right )}}{\sqrt {-e^{\left (2 i \, a\right )}}} + \frac {10 \, x e^{\left (4 i \, a\right )}}{x^{2} - e^{\left (2 i \, a\right )}} \]
-1/3*x^5/(x^2 - e^(2*I*a)) - 11/3*x^3*e^(2*I*a)/(x^2 - e^(2*I*a)) - 6*arct an(x/sqrt(-e^(2*I*a)))*e^(4*I*a)/sqrt(-e^(2*I*a)) + 10*x*e^(4*I*a)/(x^2 - e^(2*I*a))
Time = 27.40 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.89 \[ \int x^2 \cot ^2(a+i \log (x)) \, dx=-{\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\right )}^{3/2}\,\mathrm {atan}\left (\frac {x\,1{}\mathrm {i}}{\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}}\right )\,6{}\mathrm {i}-\frac {x^3}{3}-4\,x\,{\mathrm {e}}^{a\,2{}\mathrm {i}}-\frac {2\,x\,{\mathrm {e}}^{a\,4{}\mathrm {i}}}{{\mathrm {e}}^{a\,2{}\mathrm {i}}-x^2} \]